/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

/**
 *
 * @author Administrator
 */
public class reConstructFame {
    
    public static void main(String[] args) throws IOException {
        readAndWriteFile();
    }

    public static void readAndWriteFile() throws IOException {
        String filename = "F:\\Sina\\spider\\src\\data\\wb_cer.txt";
        String filename2 = "F:\\Sina\\spider\\src\\data\\fame.txt";
        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
        BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename2)));
        String line = reader.readLine();
        line = reader.readLine();
        while (line != null) {
            if (!line.isEmpty()) {
                String[] s = line.split(" ");//2 id 3 name 4 tag 5 type
                if(s[5].equals("1")){
                    writer.write(s[2]+" "+s[4]+"\r\n");
                }
            }
            line=reader.readLine();
        }
        writer.close();
        reader.close();
    }
}
